<template>
  <div class="hello">
      <ul>
        <li @click="say" v-for="(item,index) in list" :key="index">{{item}}</li>
      </ul>
  </div>
</template>

<script lang="ts">
import { Options, Vue } from 'vue-class-component';
// comPosition api  Options Api 
// Vue2 可以使用ts  vue-property-decorator(vue装饰器)
@Options({
  props: {
    msg: String
  },
  data(){
    return {}
  },
  methods: {
  },
  watch:{}
})
export default class HelloWorld extends Vue {
  msg!: string
  public list:number[] =[1,2,3]
  private myname:boolean=true;
  say(){
    alert(1)
  }
  listmany(){}
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="less">
h3 {
  margin: 40px 0 0;
}
ul {
  list-style-type: none;
  padding: 0;
}
li {
  display: inline-block;
  margin: 0 10px;
}
a {
  color: #42b983;
}
</style>
